﻿@model Springwater.Business.ViewModels.ManagePictureModel

<table>
    @foreach(var fenykep in Model.PictureList)
    {
        <tr>
            <td><img src="@Url.Content(fenykep.File)" style="width:100px;" /></td>
            <td><label>File:</label></td>
            <td>@fenykep.File</td>
            <td>Datum:</td>
            <td>@fenykep.Datum</td>
            <td>Szerzo:</td>
            <td>@fenykep.Szerzo</td>
            <td>Elsodleges:</td>
            <td style="width:10px;">@Html.RadioButton("Elsodleges", fenykep.Id, fenykep.Elsodleges, new { onclick=string.Format("ElsodlegesClicked({0})", Model.BorvizId), style="width:auto;" })</td>
            <td>@Ajax.ActionLink("Delete", "DeleteFenykep", new { borvizId = Model.BorvizId, fenykepId = fenykep.Id }, new AjaxOptions() { HttpMethod = "POST", UpdateTargetId = "divPictureList" })</td>
        </tr>
    }
</table>

<script type="text/javascript">
    function ElsodlegesClicked(borvizId) {
        var value = $("#Elsodleges:checked").val();

        $.post("@Url.Action("SetElsodleges","Borviz")", { borvizId: borvizId , fenykepId : value});
    }
</script>
